package com.kuang.Test;

import com.kuang.bean.Product;
import com.kuang.service.ProductServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class ProductTest {
    public static void main(String[] args) {
        ApplicationContext ioc = new ClassPathXmlApplicationContext("applicationContext.xml");
        ProductServiceImpl productService = ioc.getBean(ProductServiceImpl.class);
        List<Product> products = productService.queryAllProduct();
        for (Product product:products
             ) {
            System.out.println(product.getProductId()+" "+product.getProductName()+" "+product.getPrice());
        }
    }
}
